﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Windows.Forms;

namespace Moe_v0._1
{
    class MoeDebugger
    {
        // This MUST be initialized before all methods and properties of this class are used by users.
        private static TextBox _debugBuffer = null;
        public static TextBox DebugBuffer
        {
            get
            {
                Debug.Assert(_debugBuffer != null);
                return _debugBuffer;
            }
            set 
            {
                _debugBuffer = value;
            }
        }

        public static void AddDebugInfo(string debugString)
        {
            DebugBuffer.AppendText(debugString + "\r\n");
        }

        public static void ClearAllDebugInfo()
        {
            DebugBuffer.Clear();
        }

        private static bool _isDebugging = false;
        public static bool IsDebugging
        {
            get
            {
                return _isDebugging;
            }
            set
            {
                _isDebugging = value;
            }
        }
    }
}
